﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;
using OpenLightGroup.Common;

namespace Examples.ViewModels
{
    public class BaseViewModel
        : INotifyPropertyChanged
    {

   
        public BaseViewModel()
        {
            for (int i = 1; i <= 10; i++)
            {
                this.Items.Add(new Item() { IsEnabled = true, Name = "Item " + i.ToString(), Value = i });
            }

            this.Items.AddRange(this.Items);
            
        }

        private ObservableCollection<Item> _items = null;

        public ObservableCollection<Item> Items
        {
            get
            {

                if (_items == null)
                {
                    _items = new ObservableCollection<Item>();
                }
                return _items;

            }
        }
        

        


        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;
        protected void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {

                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
}
